//
//  LYQMineDefaultCell.m
//  ZCProject
//
//  Created by Zheng on 16/11/14.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQMineDefaultCell.h"

@implementation LYQMineDefaultCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UIImage *aImage = [UIImage imageNamed:@"morejticon"];
        UIImageView *aImgv = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, aImage.size.width, aImage.size.height)];
        aImgv.image = aImage;
        self.accessoryView = aImgv;
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.iconImgv];
        [self.contentView addSubview:self.titleLbl];

        [self layoutSubviewsInContentView];
    }
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_iconImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kWScale(10));
        make.centerY.equalTo(self);
        make.width.height.equalTo(@(kWScale(18)));
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_iconImgv.mas_right).offset(kWScale(10));
        make.centerY.equalTo(self);
    }];
    
}

#pragma mark - load subviews
- (UIImageView *)iconImgv {
    if (!_iconImgv) {
        _iconImgv = [[UIImageView alloc] init];
    }
    return _iconImgv;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.textColor = kHexadecimal(@"666666");
        _titleLbl.font = kWFont(15);
    }
    return _titleLbl;
}




@end
